Skip to content

Fix review findings immersed in #2520#2521

Closed
Pankraz76 wants to merge 13 commits intodiffplug:mainfrom
Pankraz76:fix-PomExtension
Closed

Fix review findings immersed in #2520#2521
Pankraz76 wants to merge 13 commits intodiffplug:mainfrom
Pankraz76:fix-PomExtension

Conversation

@Pankraz76
Copy link
Copy Markdown

Please DO NOT FORCE PUSH. Don't worry about messy history, it's easier to do code review if we can tell what happened after the review, and force pushing breaks that.

Please make sure that your PR allows edits from maintainers. Sometimes it's faster for us to just fix something than it is to describe how to fix it.

Allow edits from maintainers

After creating the PR, please add a commit that adds a bullet-point under the [Unreleased] section of CHANGES.md, plugin-gradle/CHANGES.md, and plugin-maven/CHANGES.md which includes:

  • a summary of the change
  • either
    • a link to the issue you are resolving (for small changes)
    • a link to the PR you just created (for big changes likely to have discussion)

If your change only affects a build plugin, and not the lib, then you only need to update the plugin-foo/CHANGES.md for that plugin.

If your change affects lib in an end-user-visible way (fixing a bug, updating a version) then you need to update CHANGES.md for both the lib and all build plugins. Users of a build plugin shouldn't have to refer to lib to see changes that affect them.

This makes it easier for the maintainers to quickly release your changes :)

@Pankraz76
Copy link
Copy Markdown
Author

item:

    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
  >     ... 23 more
  > Caused by: java.io.IOException: Failed to load eclipse jdt formatter: java.lang.IllegalStateException: P2 operation already in progress, close other clients or delete stale lockfile at /Users/vincent.potucek/.m2/repository/dev/equo/p2-data/metadata/.lock
  >     at com.diffplug.spotless.extra.EquoBasedStepBuilder.lambda$build$0(EquoBasedStepBuilder.java:130)
  >     at com.diffplug.spotless.JarState$Promised.get(JarState.java:73)
  >     ... 67 more
  > Caused by: java.lang.IllegalStateException: P2 operation already in progress, close other clients or delete stale lockfile at /Users/vincent.potucek/.m2/repository/dev/equo/p2-data/metadata/.lock
  >     at dev.equo.solstice.p2.LockFile.lambda$new$0(LockFile.java:54)
  >     at dev.equo.solstice.p2.FileMisc.retry(FileMisc.java:101)
  >     at de

@Pankraz76
Copy link
Copy Markdown
Author

plz disalbe me for auto build im discovering first then extract dedicated parts.

}

private static String getDefaultLineSeparator() {
return System.getProperty("line.separator", "\n");
Copy link
Copy Markdown
Author

@Pankraz76 Pankraz76 Jun 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feature envy, reimplementing java.

final String comment = token.getString();
final String withoutTrailingWhitespace = comment.replaceFirst("\\s*$", "");
token.setString(withoutTrailingWhitespace);
token.setString(token.getString().replaceFirst("\\s*$", ""));

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data High

This
regular expression
that depends on a
user-provided value
may run slow on strings with many repetitions of ' '.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be, logic is same as before. Just the field burden imposing coupling was inlined to avoid boilerplate. So only removed the documentation overhead in favor of 1 LOC concise possible statement.


final String comment = token.getString();
final String withoutTrailingWhitespace = comment.replaceFirst("\\s*$", "");
token.setString(withoutTrailingWhitespace);
Copy link
Copy Markdown
Author

@Pankraz76 Pankraz76 Jun 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (functionBracket.contains(Boolean.TRUE))
return 0;
try {
final String defaultLineSeparator = getDefaultLineSeparator();
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DRY.

@Pankraz76 Pankraz76 changed the title Fix review findings immersed #2520 Fix review findings immersed in #2520 Jun 24, 2025
@Pankraz76 Pankraz76 closed this Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants